<!DOCTYPE html>
<html lang="en" dir="ltr" class="no-js">
<head>
    <meta charset="utf-8" />
    <title>Workcraft - help:boolean_expression</title>
    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
    <meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="date" content="2014-08-21T10:55:20+0000"/>
<meta name="keywords" content="help,boolean expression"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="Workcraft"/>
<link rel="start" href="boolean_expression.html"/>
<link rel="contents" href="boolean_expression.html" title="Sitemap"/>
<link rel="alternate" type="application/rss+xml" title="Changes" />
<link rel="alternate" type="application/rss+xml" title="Current namespace" />
<link rel="edit" title="Edit this page" href="boolean_expression.html"/>
<link rel="alternate" type="text/html" title="Plain HTML" href="_export/xhtml/help/boolean_expression.xhtml"/>
<link rel="alternate" type="text/plain" title="Wiki Markup" href="_export/raw/help/boolean_expression.raw"/>
<link rel="canonical" href="http://www.workcraft.org/help/boolean_expression"/>
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.dokuwiki-light-export.css"/>
<script type="text/javascript" charset="utf-8" src="lib/exe/js.php.t.dokuwiki-light-export.js"></script>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <link rel="shortcut icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
    </head>

<body>
    <!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
    <div id="dokuwiki__site"><div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki-light-export loggedIn    ">

        
<!-- ********** HEADER ********** -->
<div id="dokuwiki__header"><div class="pad group">

        <h1><a href="start.html"  title="Workcraft start page"><img src="logo.png" width="327" height="57" alt="" /></a></h1>
    
    <div class="tools group">
        <!-- USER TOOLS -->
                    <div id="dokuwiki__usertools">
                <h3 class="a11y">User Tools</h3>
                <ul>
                    <li><a href="boolean_expression.html"  class="action admin" rel="nofollow" title="Admin">Admin</a></li><li><a href="boolean_expression.html"  class="action profile" rel="nofollow" title="Profile">Profile</a></li><li><a href="boolean_expression.html"  class="action logout" rel="nofollow" title="Logout">Logout</a></li>                </ul>
            </div>
        
        <!-- SEARCH TOOLS -->
        <div id="dokuwiki__searchtools">
            <h3 class="a11y"></h3>
            <form action="start.html" accept-charset="utf-8" class="search" id="dw__search" method="get" role="search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" class="edit" title="[F]" /><input type="submit" value="Search" class="button" title="Search" /><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>        </div>

        <!-- SITE TOOLS -->
        <div id="dokuwiki__sitetools">
            <h3 class="a11y">Site Tools</h3>
                            <div class="mobileTools">
                    <form action="/doku.html.doku.php.html" method="get" accept-charset="utf-8"><div class="no"><input type="hidden" name="id" value="help:boolean_expression" /><input type="hidden" name="sectok" value="e34c56bfd8edc313c7401affc7c1a757" /><select name="do" class="edit quickselect" title="Tools"><option value="">Tools</option><optgroup label="Page Tools"><option value="edit">Edit this page</option><option value="revisions">Old revisions</option><option value="backlink">Backlinks</option></optgroup><optgroup label="Site Tools"><option value="recent">Changes</option><option value="media">Media</option><option value="index">Sitemap</option></optgroup><optgroup label="User Tools"><option value="logout">Logout</option><option value="profile">Profile</option><option value="admin">Admin</option></optgroup></select><input type="submit" value="&gt;" /></div></form>                </div>
                <ul>
                    <li><a href="boolean_expression.html"  class="action recent" accesskey="r" rel="nofollow" title="Changes [R]">Changes</a></li><li><a href="boolean_expression.html"  class="action media" rel="nofollow" title="Media">Media</a></li><li><a href="boolean_expression.html"  class="action index" accesskey="x" rel="nofollow" title="Sitemap [X]">Sitemap</a></li>                </ul>
                    </div>
    </div>

    <!-- BREADCRUMBS -->
    
    <hr class="a11y" />
</div></div><!-- /header -->

        <div class="wrapper group">

            
            <!-- ********** CONTENT ********** -->
            <div id="dokuwiki__content"><div class="pad group">
                <div class="pageId"><span>help:boolean_expression</span></div>
                <div class="page group">
                                                            <!-- wikipage start -->
                    
<h1 class="sectionedit1" id="boolean_expressions">Boolean expressions</h1>
<div class="level1">

<p>
The Boolean expressions are employed in <a href="cpog_plugin.html" class="wikilink1" title="help:cpog_plugin">Conditional Partial Order Graph plugin</a> to specify the graph conditions and in <a href="digital_circuit_plugin.html" class="wikilink1" title="help:digital_circuit_plugin">Digital Circuit plugin</a> to specify set/reset functions of circuit components. Workcraft recognises the following fairly standard syntax for the Boolean expressions:
</p>
<pre class="code">&lt;expression&gt; ::= &lt;term&gt; | &lt;term&gt; + &lt;expression&gt; | &lt;term&gt; ^ &lt;expression&gt; | &lt;expression&gt; =&gt; &lt;expression&gt;
&lt;term&gt; ::= &lt;factor&gt;  | &lt;factor&gt; * &lt;term&gt;
&lt;factor&gt; ::= &lt;literal&gt; | &lt;literal&gt;&#039; | (&lt;expression&gt;) | (&lt;expression&gt;)&#039;
&lt;literal&gt; ::= C_STYLE_NAME | 0 | 1</pre>

<p>
The following five Boolean operators are used in this grammar:
</p>
<ul>
<li class="level1"><div class="li">
 <code>*</code> - <a href="http://en.wikipedia.org/wiki/Logical_conjunction" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Logical_conjunction">conjunction (AND)</a>; alternatively <code>&amp;</code> can be used, but it will be automatically replaced by <code>*</code>.
</div></li>
<li class="level1"><div class="li">
 <code>+</code> - <a href="http://en.wikipedia.org/wiki/Logical_disjunction" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Logical_disjunction">disjunction (OR)</a>; alternatively <code>|</code> can be used, but it will be automatically replaced by <code>+</code>.
</div></li>
<li class="level1"><div class="li">
 <code>^</code> - <a href="http://en.wikipedia.org/wiki/Exclusive_or" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Exclusive_or">exclusive disjunction (XOR)</a>.
</div></li>
<li class="level1"><div class="li">
 <code>&#039;</code> - <a href="http://en.wikipedia.org/wiki/Negation" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Negation">Negation (NOT)</a>; alternatively prefix <code>!</code> can be used, but it will be automatically replaced by suffix <code>&#039;</code>.
</div></li>
<li class="level1"><div class="li">
 <code>=&gt;</code> - <a href="http://en.wikipedia.org/wiki/Material_conditional" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Material_conditional">implication</a>
</div></li>
</ul>


<p>
Here are few examples of good Boolean expressions:
</p>
<ul>
<li class="level1"><div class="li">
 <code>a+b</code>
</div></li>
<li class="level1"><div class="li">
 <code>(op1*op2)&#039;</code>
</div></li>
<li class="level1"><div class="li">
 <code>(A+B)&#039; =&gt; C*(D^E&#039;)</code>
</div></li>
</ul>


</div>

                    <!-- wikipage stop -->
                                    </div>

                                            </div></div><!-- /content -->

            <hr class="a11y" />

            <!-- PAGE ACTIONS -->
            <div id="dokuwiki__pagetools">
                        </div>
        </div><!-- /wrapper -->

        
<!-- ********** FOOTER ********** -->
<div id="dokuwiki__footer"><div class="pad">
    
    <div class="buttons">
                <a href="http://www.dokuwiki.org/donate" title="Donate" ><img
            src="lib/tpl/dokuwiki-light-export/images/button-donate.gif" width="80" height="15" alt="Donate" /></a>
        <a href="http://www.php.net" title="Powered by PHP" ><img
            src="lib/tpl/dokuwiki-light-export/images/button-php.gif" width="80" height="15" alt="Powered by PHP" /></a>
        <a href="http://validator.w3.org/check/referer" title="Valid HTML5" ><img
            src="lib/tpl/dokuwiki-light-export/images/button-html5.png" width="80" height="15" alt="Valid HTML5" /></a>
        <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" ><img
            src="lib/tpl/dokuwiki-light-export/images/button-css.png" width="80" height="15" alt="Valid CSS" /></a>
        <a href="http://dokuwiki.org/" title="Driven by DokuWiki" ><img
            src="lib/tpl/dokuwiki-light-export/images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" /></a>
    </div>

</div></div><!-- /footer -->

    </div></div><!-- /site -->

    <div class="no"><img  width="2" height="1" alt="" /></div>
    <div id="screen__mode" class="no"></div>    <!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
</body>
</html>

